<template>
    <div id="myeditor" style="width: 100%;"></div>
</template>

<script setup>
import { ref, reactive, toRefs, onMounted } from 'vue'
import E from 'wangeditor'
const emit = defineEmits(['event'])
const props = defineProps({
    content: String
})
onMounted(() => {
    const editor = new E('#myeditor')
    editor.create()
    // console.log(props);
    props.content && editor.txt.html(props.content)
    editor.config.onchange = function (newHtml) {
        // console.log("the new html of afther content-change",newHtml);
        emit("event", newHtml)
    }
})

</script>
<style scoped lang="scss"></style>